package com.dragon.graduation.graduationMaterial.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.dragon.graduation.graduationMaterial.controller.dto.GraduationMaterialSearchDTO;
import com.dragon.graduation.graduationMaterial.controller.vo.GraduationMaterialVO;
import com.dragon.graduation.graduationMaterial.entity.GraduationMaterialEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * <p>
 * 毕业材料表 Mapper 接口
 * </p>
 *
 * @author dragon
 * @since 2025-02-28 21:17:48
 */
@Mapper
public interface GraduationMaterialMapper extends BaseMapper<GraduationMaterialEntity> {

    @Select("select * from db_graduation_material where project_id = #{projectId} and student_id = #{studentId} and status!=2 ORDER BY update_time LIMIT 1")
    GraduationMaterialEntity selectByProjectIdAndStudentId(@Param("projectId") Integer projectId, @Param("studentId") Integer studentId);

    Page<GraduationMaterialVO> selectPages(Page<GraduationMaterialEntity> entityPage, @Param("searchDTO") GraduationMaterialSearchDTO searchDTO);
}
